(function(){
    "use strict";
    app.controller('netCtrl', ['$scope', 'httpLoad', '$rootScope','$modal','$state','$timeout','LANGUAGE',
        function($scope, httpLoad, $rootScope, $modal,$state, $timeout,LANGUAGE) {
            $rootScope.moduleTitle = '容器管理 > 网络';//定义当前页
            $rootScope.link = '/statics/css/common.css';//引入页面样式
            $scope.enterCon = function($event,netId){
                $($event.target).addClass('font14');
                $($event.target).siblings().removeClass('font14');
                $($event.target).parent().next().find(".app-row").parent().hide();
                $($event.target).parent().next().find(".con-row").parent().show();
            }
            $scope.enterApp = function($event,netId){
                $($event.target).addClass('font14');
                $($event.target).siblings().removeClass('font14');
                $($event.target).parent().next().find(".app-row").parent().show();
                $($event.target).parent().next().find(".con-row").parent().hide();
            }
            $scope.param = {
                rows: 10
            };
            $scope.isbatchDelete = true;
            //获取主机列表
            $scope.getData = function(page){
                $scope.param.page = page || $scope.param.page;
                var params = {
                        page: $scope.param.page,
                        rows: $scope.param.rows,
                        name: $scope.searchByName,
                    };
                httpLoad.loadData({
                    url:'/deployer/getAllNetworksInfo.do',
                    data: params,
                    success:function(data){
                        if(data.rows&&data.rows.length!=0){
                            $scope.netList = data.rows;
                            $scope.totalCount = data.records;
                            $scope.isImageData = false;
                        }else{
                            $scope.isImageData = true;
                        }
                    }
                });
            };
            $scope.getData(1);
            
            $scope.appMore = function(id){  //打开模态
                $state.go('app.application.develop',{flag:4});
            };
            $scope.goApp = function(item){  //打开模态
                $state.go('app.application.developDetail',{id:item.appId,appName:item.appName.substring(0,item.appName.indexOf("-")),appCoreRename:item.appName,flag:2});
            };
            $scope.goCon = function(item){  //打开模态
                $state.go('app.containerManger.containerDetail',{conName:item,flag:2});
            };
        }
    ]);
})();